<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
//
 echo'
<div id="content">
<h5 class="info-title">Event Editor</h5>
<h2>New Event</h2>
<p>To create a new event, simply type the title of the article and press create. The article with the given title will now be editable using the article editor.</p>
<form action="plugin/extravaganza/cms/newevent.php" method="post">
<TABLE BORDER="0">
  <TR>
    <TD>Title:</TD>
    <TD>
      <INPUT TYPE="TEXT" NAME="newtitle" SIZE="74"><INPUT TYPE="SUBMIT" VALUE="Create" NAME="newform">
    </TD>
  </TR>
  </TABLE>
</form>
<a href="#top">Top ^</a>',
'<h2>Event Header</h2>';
'<p>To edit the event heading, first select the event. You can filter the results of the event selection box based on tag and date. </p>';


$sql='SELECT event_id, event_title FROM Event';
$result=mysql_query($sql);

while($row=mysql_fetch_array($result)){
    $id = $row['event_id'];
    $thing = $row['event_title'];
    if ($thing == ""){


        $subsql="SELECT subevent_title FROM SubEvent WHERE subevent_mainevent = '$id'";
        $r=mysql_query($subsql);
        $a= mysql_num_rows ($r);

        if (mysql_num_rows ($r) == 1){

            while ($srow=mysql_fetch_array($r)){
            $thing = $srow['subevent_title'];
            }
        }
    }
    $options.="<OPTION VALUE=\"$id\">" . $thing;
}

echo'
<form>
<select name="eventID" onchange="showMain(this.value)">
<OPTION VALUE=0>Select event...',$options,'</select>
</form><br />
<div id="txtHint"><b>
</b></div>
</p>
<a href="#top">Top ^</a>',
'<h2>SubEvent Editor</h2>',
'<p>To edit the event heading, first select the event.
    You can filter the results of the event selection box based on tag and date. </p>';
$sql='SELECT event_id, event_title FROM Event';
$result=mysql_query($sql);

while($row=mysql_fetch_array($result)){
    $id = $row['event_id'];
    $thing = $row['event_title'];
 

    if ($thing == ""){
        

        $subsql="SELECT subevent_title FROM SubEvent WHERE subevent_mainevent = '$id'";
        $r=mysql_query($subsql);
        $a= mysql_num_rows ($r);
  
        if (mysql_num_rows ($r) == 1){
         
            while ($srow=mysql_fetch_array($r)){
            $thing = $srow['subevent_title'];
            }
        }
    }

    $options.="<OPTION VALUE=\"$id\">" . $thing;
}

echo'
<form><select name="eventID" onchange="showSubBox(this.value)">
<OPTION VALUE=0>Select event...',$options,'</select>
</form><br />
<div id="txtHint2"><b>
</b></div>
<a href="#top">Top ^</a>
</div></div><!-- end of inside -->'
        ;

?>
